<template>
  <div class="seach">
    <div class="input">
      <form action="/">
        <van-search
          v-model="value"
          show-action
          placeholder="请输入搜索关键词"
          @search="onSearch"
          @cancel="onCancel"
        />
      </form>
    </div>
    <div>
      {{ this.val }}
    </div>
    <!-- <listComponents :val="value"></listComponents> -->
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { showToast } from "vant";
import { getGoodList } from "./api";
import listComponents from "../../components/listComponents.vue";
import router from "../../router";
const value = ref("");
const onSearch = (val: any) => {
  showToast(val);
  console.log(val, "val");
  let value = val;
  console.log(value, "value");
};
const onCancel = () => {
    // showToast("取消");
  router.back()
};
</script>

<style scoped lang="scss">
.seach {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  width: 100%;
}
</style>
